﻿using HandmadeShop.BusinessLogic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace HandmadeShop.Application.Controllers
{
    public class HomeController : BaseController
    {
        private ProductBL productBL;
        private HandmadeShop.Application.Models.BusinessLogic.ProductBL bl;

        public HomeController()
        {
            this.productBL = new ProductBL();

            if (this.productBL != null)
            {
                this.bl = new Models.BusinessLogic.ProductBL(this.productBL);
            }
        }

        public ActionResult Index()
        {
            ViewBag.ProductTypes = this.bl.GetMenuItems();
            ViewBag.NewProducts = this.bl.GetNewProducts();
            ViewBag.HotProducts = this.bl.GetHotProducts();
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
